<template>
    <el-dialog
            :center="true"
            :show-close="false"
            :visible="show"
            @close="close"
            lock-scroll
    >
        <div slot="title">
            <div>{{messInfo.title}}</div>
        </div>
        <div class="conten">{{messInfo.content}}</div>
    </el-dialog>
</template>

<script>
    export default {
        data() {
            return {
                user: {
                    phone: "",
                    passWord: ""
                }
            };
        },
        methods: {
            go() {
                this.$router.push("/regist");
            },
            login() {
                this.$http.get(
                    "userController/login",
                    {
                        phone: 13996562599,
                        passWord: 123
                    },
                    res => {
                        if (res.code === 0) {
                            this.$message({
                                message: "登录成功",
                                type: "success"
                            });
                            this.$store.commit("loginChange", true);
                            this.$store.commit("setUserInfo", res.data);
                            this.$router.push("/home");
                        } else {
                            this.$message({
                                message: "登录失败",
                                type: res.error
                            });
                        }
                    }
                );
            },
            close() {
                this.$emit("close");
            }
        },
        props: {
            show: {
                type: Boolean,
                default: false
            },
            messInfo: {
                type: Object,
                default: () => ({ title: "咨询消息", content: "111" })
            }
        }
    };
</script>

<style lang="scss" scoped>
</style>
